<!DOCTYPE html>
<html>
<head>
    <title></title>
    <script src="js/jquery-1.11.1.min.js"></script>
    <script src="js/ajaxfileupload.js"></script>
</head>
<body>
<input type="file" id="upload" name="upload"/>
<button id="btnCommit">提交</button>
<img id="show"/>
<script>
    function ajaxFileUpload() {
        $.ajaxFileUpload
        (
            {
                url: 'uploadhandle.php',
                secureuri: false,
                fileElementId: 'upload',
                dataType: 'json',
                success: function (data, status) {

                    //alert(data);
                    $("#show").attr("src", data.filename);


                },
                error: function (data, status, e) {
                    alert(e);
                }
            }
        )

        return false;

    }

    $("#btnCommit").bind('click', function () {
        ajaxFileUpload();
    });
</script>
</body>
</html>